import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 引入element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 引入样式文件
import './styles/index.less'

Vue.config.productionTip = false

// 引入echarts
import * as echarts from "echarts"
Vue.prototype.$echarts = echarts

// 全局过滤器过滤时间戳
Vue.filter('formDate', function(val1, data1) {
    let val = new Date(val1)
    let y = val.getFullYear()
    let m = val.getMonth() + 1
    let days = val.getDate()
    let h = val.getHours()
    let mm = val.getMinutes()
    let ss = val.getSeconds()


    m = m < 10 ? '0' + m : m;
    days = days < 10 ? '0' + days : days;
    h = h < 10 ? '0' + h : h;
    mm = mm < 10 ? '0' + mm : mm;
    ss = ss < 10 ? '0' + ss : ss;
    if (data1 && data1.includes('yyyy-dd-mm')) {
        return `${y}- ${m}-${days}`

    } else {
        return `${y}- ${m}-${days} ${h}:${mm}:${ss}`
    }

})


new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')